package com.aotain.oframework.dto;

import java.io.Serializable;

public class PageDTO implements Serializable {

	private static final long serialVersionUID = 1L;
	private int pageNumber;
	private int pagesize;
	private String sort;
	private String colName;
	private String sqlColNames;
	private Object criteria;

	public PageDTO(int pageNumber, int pagesize, String sort, String colName,
			String sqlColNames, Object criteria) {
		this.pageNumber = pageNumber;
		this.pagesize = pagesize;
		this.sort = sort;
		this.colName = colName;
		this.sqlColNames = sqlColNames;
		this.criteria = criteria;
	}

	public PageDTO() {
	}

	public Object getCriteria() {
		return criteria;
	}

	public void setCriteria(Object criteria) {
		this.criteria = criteria;
	}

	public int getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public int getPagesize() {
		return pagesize;
	}

	public void setPagesize(int pagesize) {
		this.pagesize = pagesize;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getColName() {
		return colName;
	}

	public void setColName(String colName) {
		this.colName = colName;
	}

	public String getSqlColNames() {
		return sqlColNames;
	}

	public void setSqlColNames(String sqlColNames) {
		this.sqlColNames = sqlColNames;
	}

	public int getOffset() {
		return this.getPageNumber() * this.pagesize;
	}

	public int getOffset2() {
		return (this.getPageNumber() - 1) * this.pagesize;
	}

}
